package app.auto;

import android.content.Context;
import android.content.Intent;

import java.util.Map;

import app.auto.runner.base.BroadcastBuilder;
import app.auto.runner.base.intf.FunCallback;

public class AndroidInto extends AndroidInstance {

    public void init(final Context ctx) {
        BroadcastBuilder.build().receive(getClass().getSimpleName(), "", getContext(), new FunCallback() {
            @Override
            public void onCallback(Object result, Object object) {
                super.onCallback(result, object);
                Map m = (Map) ((Intent) object).getSerializableExtra("params");

                usage(m);
            }

        });
    }

    public void unregister(Context ctx) {
        BroadcastBuilder.remove(getClass().getSimpleName(), getContext());

    }

    @Override
    public AndroidInstance use(Object mp, Object... p) {
        return null;
    }
}
